#bin/bash
# " -sys s[,s...] nav system(s) (s=G:GPS,R:GLO,E:GAL,J:QZS,C:BDS,I:IRN) [G|R]",
# " -v thres  validation threshold for integer ambiguity (0.0:no AR) [3.0]",
# " -i        instantaneous integer ambiguity resolution [off]",
# " -h        fix and hold for integer ambiguity resolution [off]",
################################################################################################
                             # baseline station configuration
##########################星历文件###########################################
# HKNP:22.249065941666668 113.8938815583333 350.682
# HKWS:22.434280258333333 114.335383980555556 63.763


day=2022130 
eph=BRDC00IGN_R_${day}0000_01D_MN.rnx

# fsp3=EPH/GBM0MGXRAP_20220010000_01D_05M_ORB.SP3
# fclk=EPH/GBM0MGXRAP_20220010000_01D_05M_CLK.CLK

# fsp3pre=EPH/GBM0MGXRAP_20213650000_01D_05M_ORB.SP3
# fclkpre=EPH/GBM0MGXRAP_20213650000_01D_05M_CLK.CLK

# fsp3post=EPH/GBM0MGXRAP_20220020000_01D_05M_ORB.SP3
# fclkpost=EPH/GBM0MGXRAP_20220020000_01D_05M_CLK.CLK

# $fsp3pre $fsp3 $fsp3post $fclkpre $fclk $fclkpost
#################################################################
######################### used in paper #########################
#################################################################
# ###############################################################

# ###############################################################

BasPos="22.434280258333333 114.335383980555556 63.763" #109.8km
basename=HKWS00HKG_R_${day}
rovername=HKSL00HKG_R_${day}
# rovername=T43000HKG_R_2022129


# Stations=hknp_hkws
Stations=hksl_hkws
# Stations=t430_hkws
# Stations=hklm_hkws

# conffile=../../CONFS/rtk_WL_CIR2021.conf
conffile=hkslsetup.conf

                          # rnx2rtkp processing strategies
################################################################################################
for hour in {14..23}; do
# hour=14
sthour=$(printf "%02d" "$hour")
# starttime="2022/01/01 "${sthour}":00:00"
echo $Stations
# starttime="2019/08/01 08:00:00"
# conffile2=CONFS/rtk_iflc_flt2021.conf

# conffile=CONFS/rtk_WL_CIR_iono_brdc.conf
# demo5_conffile=CONFS/demo5_rtk_iono_brdc.conf 
# demo5_conffile=CONFS/demo5_rtk.conf

rover=${rovername}${sthour}00_01H_01S_MO.rnx
base=${basename}${sthour}00_01H_01S_MO.rnx

# echo "demo5 FAR"
# # ./rnx2rtkp_demo5 -k $demo5_conffile -ts $starttime -l $BasPos $rover $base $eph $fsp3pre $fsp3 $fsp3post $fclkpre $fclk $fclkpost -o RES/${Stations}_${day}_FAR_demo5_ge_prec_${sthour}.pos #> /dev/null 2>&1 
echo "FAR"
./rnx2rtkp -k $conffile -v 3 -ti 1 -l $BasPos obs/$rover obs/$base eph/$eph -o RES/${Stations}_${day}_FARv3_new_GRCE_${sthour}.pos #> /dev/null 2>&1 
echo "TSRC"
./rnx2rtkp5 -k $conffile -tsrc -ti 1 -l $BasPos obs/$rover obs/$base eph/$eph  -o RES/${Stations}_${day}_TSRC_new_GRCE_${sthour}.pos #> /dev/null 2>&1 

done


# ######Takasu long baseline processing setup #############
# conffile=CONFS/rtk_general_takasu_ref.conf
# echo "Takasu Setup"
# ./rnx2rtkp -k $conffile -v 3 -l $BasPos $rover $base $eph $fsp3pre $fsp3 $fsp3post $fclkpre $fclk $fclkpost -o RES/${Stations}_${day}_Takasu_ge_prec.pos > /dev/null 2>&1 

# #######SPP #############
# station=$rover
# conffile=CONFS/spp2021.conf
# echo "SPP"
# ./rnx2rtkp_newbds3 -k $conffile $station $eph $fsp3 $fclk -o RES/${station}_${day}_spp.pos #> /dev/null 2>&1 


# conffile=CONFS/rtk_WL_CIR_wlnltsrc.conf
# echo "GB-WLNL+TSRC"
# ./rnx2rtkp -k $conffile -l $BasPos $rover $base $eph $fsp3pre $fsp3 $fsp3post $fclkpre $fclk $fclkpost -o RES/${Stations}_${day}_GB_WLNL_TSRC_ge_prec.pos > /dev/null 2>&1 

